import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'
import Login from '../views/login/index.vue'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router

export const asyncRoute = [
    {
        path: '/product/product-detail',
        name: 'ProductDetail',
        component: () => import('@/views/product/product-detail.vue')
    },
    {
        path: '/system/role-detail',
        name: 'RoleDetail',
        component: () => import('@/views/system/role-detail.vue')
    }
]
